using System;
using Avalonia.Controls;

namespace ExcelMerge;

public enum WindowMode
{
    Diff,
    Merge
}

public class MainWindowArgs(WindowMode mode, object arg)
{
    public WindowMode Mode { get; } = mode;
    public object Argument { get; } = arg;
}

public partial class MainWindow : Window
{
    public MainWindow(MainWindowArgs args)
    {
        InitializeComponent();
        switch (args.Mode)
        {
            case WindowMode.Diff:
                Content = new DiffView(args.Argument);
                break;
            case WindowMode.Merge:
                Content = new MergeView(args.Argument);
                break;
            default:
                Environment.Exit(1);
                throw new Exception("未知窗口模式");
        }
    }
}